package com.herench.bunch.clinic.handler;

import com.alibaba.fastjson.JSON;
import com.herench.bunch.clinic.agent.ClinicAgent;
import com.herench.bunch.clinic.convert.InsuranceTypeConvert;
import com.herench.bunch.commons.annotation.Handler;
import com.herench.bunch.commons.support.AbstractMessageHandler;
import org.dom4j.Document;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

@Handler(code = "200260", name = "查询门特类型信息" ,messageConvertClass = InsuranceTypeConvert.class)
public class InsuranceTypeHandlerClinic extends AbstractMessageHandler {


    @Autowired
    private ClinicAgent clinicAgent;

    @Override
    protected Object proxyInvoke(Object inMessage) throws Exception {
        Document message = (Document) inMessage;
        List<Map<String,Object>> res = clinicAgent.insuranceType();
        String req = JSON.toJSONString(res);
        return req;
    }
}
